package com.ctbri.gui;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;

import com.ctbri.util.SwingConsole;

public class BoxLayoutDemo extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JButton button1 = new JButton("button1"), button2 = new JButton("button2");
	public BoxLayoutDemo() {
		BoxLayout layout = new BoxLayout(this.getContentPane(), BoxLayout.X_AXIS);
		setLayout(layout);
		add(Box.createHorizontalStrut(100));
		add(button1);
		add(Box.createGlue());
		add(button2);
		add(Box.createHorizontalStrut(100));
	}

	public static void main(String[] args) {
		SwingConsole.run(new BoxLayoutDemo(), 1000, 500);
	}

}
